﻿using Furion.ConfigurableOptions;
using GnpFine.Core;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json.Linq;

namespace GnpFine.Application.NmpaSystem
{
    /*    
    4.2.5.1 选项查找键流程    
        没有贴[OptionsSettings] 特性，
        以 Options 结尾，则去除 Options 字符串
        否则返回 类名称

        贴了 [OptionsSettings] 特性
        如果配置了 Path 属性，则返回 Path 的值
        否则返回 类名称
     */

    /*
          在 Furion 框架中，配置选项后期配置很简单，
          只需要继承 IConfigurableOptions<TOptions> 接口并实现 PostConfigure(TOptions options) 方法。
     */

    [OptionsSettings("KdcloudString")]
  public class NmpaOptionsSet : IConfigurableOptions<NmpaOptionsSet>
  {
        #region 配置字段

        public string VER { get; set; }
        public string KDCLOUD_URL { get; set; }
        public string KDCLOUD_DBID { get; set; }
        public string KDCLOUD_USERNAME { get; set; }
        public string KDCLOUD_PASSWORD { get; set; }

        /*  

        public string KDCLOUD_URL { get; set; } = "https://xjwondfo.ik3cloud.com/k3cloud/";
        public string KDCLOUD_DBID { get; set; } = "20210309183621293";
        public string KDCLOUD_USERNAME { get; set; } = "administrator";
        public string KDCLOUD_PASSWORD { get; set; } = "123123.wf";

        */


        /*
       public string VER { get; set; } = "2";
       public string KDCLOUD_URL { get; set; } = "http://localhost:1200/";
       public string KDCLOUD_DBID { get; set; } = "65747baa21c124";
       public string KDCLOUD_USERNAME { get; set; } = "administrator";
       public string KDCLOUD_PASSWORD { get; set; } = "123qwe!@#QWE";
       */




        /*
        public const string KDCLOUD_URL = "http://127.0.0.1/K3cloud/";
        public const string KDCLOUD_DBID = "609c8cea03da5a";
        public const string KDCLOUD_USERNAME = "administrator";
        public const string KDCLOUD_PASSWORD = "12qw!@QW";
         */

        #endregion


        // 选项的后期配置
        public void PostConfigure(NmpaOptionsSet options, IConfiguration configuration)
        {
            // options.KDCLOUD_URL ??= "Furion";
            // options.KDCLOUD_DBID ??= "1.0.0";
            // options.KDCLOUD_USERNAME ??= "Baiqian";
            // options.KDCLOUD_PASSWORD ??= "Baiqian";
        }
    }
}